<?php
namespace app\api\controller\vuser;
class Withdraw extends Base
{
    //列表
    public function lists(){
      $this->checkLogin();
      $d = $this->post();
      $rule = [
        'page' => 'require',
        'limit' => 'require',
      ];
      $msg = [];
      check($rule, $msg, $d);
      $rs = $this->db->query("select * from withdraw where user_id = ? order by id desc ". limit($d['page'], $d['limit']),[$this->userinfo['id']]);
      foreach($rs as $k => $v){
        $rs[$k]['status'] = c("type.withdraw_status.{$v['status']}");
        $rs[$k]['create_time_name'] = com_time_format($v['create_time'],'Y-m-d');
      }
      suc($rs);
    }
}
